﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Media.Imaging;
using FinosLibrary;
namespace BattleShipOnline {
    public class User:NotifyProperty {
        public int id;
        public string name { get; set; }
        public double money { get; set; }
        public string ip;
        public DateTime lastLogin;
        public string face;
        public string shell;
        public string item;
        public BitmapImage _faceImage;
        public BitmapImage faceImage {
            get {
                if (_faceImage == null || _faceImage.UriSource.OriginalString != face) _faceImage = Custom.GetBitmapImage(face);
                return _faceImage;
            }
        }
        public string ID {
            get {
                string str = "00000000" + id.ToString();
                return str.Substring(str.Length-8, 8);
            }
        }
        public int[] shells { get { return shell.FromJsonTo<int[]>(); } }
    }
}
